package cn.iocoder.yudao.module.nmkj.controller.app.companyintroduction;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.nmkj.dal.dataobject.companyintroduction.CompanyIntroductionDO;
import cn.iocoder.yudao.module.nmkj.service.companyintroduction.CompanyIntroductionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户APP - 公司介绍")
@RestController
@RequestMapping("/nmkj/company-introduction")
@Validated
public class AppCompanyIntroductionController {

    @Resource
    private CompanyIntroductionService companyIntroductionService;

    /**
     * 无需请求参数，业务方法还是使用原有 请求分页 方法
     * @return 单个公司介绍实例
     */
    @GetMapping("/single")
    @Operation(summary = "获得公司介绍")
    public CommonResult<CompanyIntroductionDO> getCompanyIntroductionSingle() {
        CompanyIntroductionDO companyIntroductionDO = companyIntroductionService.getCompanyIntroductionSingle();
        return success(BeanUtils.toBean(companyIntroductionDO, CompanyIntroductionDO.class));
    }

}
